
package require Img
canvas .c -width 400 -height 200
pack .c
	image create photo caca -file map.jpg
	#$this(canvas) create image [lindex $this(entityPixXY) 0] [lindex $this(entityPixXY) 1] -anchor n  -image ${farmer}Pix -tags ${farmer}PixTag
	
	
	
.c create text 70 50 -text "Photo" -tag movable
.c create image 200 50 -image caca -tag movable
.c bind movable <Button-1> {Mark %x %y %W}
.c bind movable <B1-Motion> {Drag %x %y %W}
proc Mark {x y w} {
 	global state
 	set state($w,obj) [$w find closest $x $y]
 	set state($w,x) $x;	set state($w,y) $y
}
proc Drag {x y w} {
 	global state
 	set dx [expr $x -$state($w,x)];	set dy [expr $y -$state($w,y)]
 	$w move $state($w,obj) $dx $dy
 	set state($w,x) $x;	set state($w,y) $y
}
.c configure -background green
